package cn.sumpu.app.guoguojie.constant;

import java.util.HashMap;
import java.util.Map;

public enum BlogVisibility {
	ALL("01", "任何人可见"), ALLFRIEND("02", "所有邻居可见"), MYSELF("03", "仅自己可见");
	private String value;
	private String label;

	private static Map<String, String> cache;

	static {
		cache = new HashMap<String, String>();
		cache.put(ALL.getValue(), ALL.getLabel());
		cache.put(ALLFRIEND.getValue(), ALLFRIEND.getLabel());
		cache.put(MYSELF.getValue(), MYSELF.getLabel());
	}

	private BlogVisibility(String value, String label) {
		this.value = value;
		this.label = label;
	}

	public String getValue() {
		return value;
	}

	public String getLabel() {
		return label;
	}

	public static String getLabelByValue(String value) {
		return cache.get(value);
	}
}
